<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/include.jsp"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css"  href="<%=request.getContextPath()%>/styles/css/default.css" />
</head>

<body>
<div class="main">
<div class="main_title"><b>你当前的位置</b>：权限管理-角色列表</div>
<s:form id="roleForm" namespace="/role" action="list">
<s:hidden name="pageSize" id="pageSize"/>
<table align="center"  cellpadding="1" cellspacing="1" class="search">
    <tr class="listr2">
        <td align="right" class="listr6">角色名</td>
		<td align="left" class="listr5"><s:textfield name="role.name" class="searchInput"/></td>
		<td align="right" class="listr6">角色描述</td>
		<td align="left" class="listr5"><s:textfield name="role.detail" class="searchInput"/></td>
	</tr>
	<tr style="height:30px;background:#FDFAF2;padding-top:3px;">
		<td align="center" colspan="4">
			<s:submit cssClass="btn" onmouseover="this.className='btn_hover'" onmouseout="this.className='btn'" value="查 询" />
    		<input name="Submit9" type="reset" class="btn"  onmouseover="this.className='btn_hover'" onmouseout="this.className='btn'" value="重 置" />
		</td>
	</tr>
 </table>
 </s:form>
<div class="botton">
	<s:form namespace="/role" action="addOrUpdate!input.action">
		<s:hidden name="function.parent.id"/>
		<input type="submit" class="add" onmouseover="this.className='add_hover'" onmouseout="this.className='add'" value="新增"></input>
	</s:form>
</div>

<table align="center"  cellpadding="1" cellspacing="1" class="tablelist">
  			<tr class="toptitle">
				<td >
					角色名称
				</td>
				<td >
					角色描述
				</td>
				<td >
					操作
				</td>
			</tr>
			<s:iterator value="page.res" status="status">
				<s:if test="#status.even">
				 <tr class="listr1" onmouseover="this.className='listr3'" onmouseout="this.className='listr1'">
				</s:if>
				<s:else>
				 <tr class="listr2" onmouseover="this.className='listr3'" onmouseout="this.className='listr2'">
				</s:else>
					<td>
						&nbsp;
						<s:property value="name" />
					</td>
					<td>
						&nbsp;
						<s:property value="detail" />
					</td>
					
					<td>
						&nbsp;
						<s:url id="modifyUrl" namespace="/role"
							action="addOrUpdate!input">
							<s:param name="role.id">
								<s:property value="id" />
							</s:param>
						</s:url>
						<s:url id="viewUrl" namespace="/role"
							action="view">
							<s:param name="role.id">
								<s:property value="id" />
							</s:param>
						</s:url>
						<s:url id="deleteUrl" namespace="/role"
							action="list!deleteRole">
							<s:param name="role.id">
								<s:property value="id" />
							</s:param>
						</s:url>
						<s:url id="grantUrl" namespace="/role"
							action="grant!input">
							<s:param name="role.id">
								<s:property value="id" />
							</s:param>
						</s:url>
						<s:url id="grantRightUrl" namespace="/role"
							action="grantDataRight!input">
							<s:param name="role.id">
								<s:property value="id" />
							</s:param>
						</s:url>
						<s:a href='%{modifyUrl}'>修改</s:a>
						<s:a href='%{viewUrl}'>查看</s:a>
						<s:a href='%{deleteUrl}'>删除</s:a>
						<s:a href='%{grantUrl}'>分配功能</s:a>
						<s:a href='%{grantRightUrl}'>分配数据权限</s:a>
						
					</td>
					
				</tr>
			</s:iterator>
		</table>
			
		
			<!-- 分页 -->
		<table class="tablelist" >			
		<s:set  var="totle" scope="request" value="page.count"/>
		<s:set  var="pageSize" scope="request" value="pageSize"/>
		<%
					Integer count = (Integer) request.getAttribute("totle");
					Integer pageSize = (Integer) request.getAttribute("pageSize");
		%>
		
			<tr>
			<td class="listr4" colspan="3">
				
				<pg:pager  url="list.action" items='<%=count.intValue()%>'
					maxPageItems='<%=pageSize%>' export="currentPage=pageNumber">
					<pg:param name="role.name" />
					<pg:param name="role.detail" />
					<pg:param name="pageSize" />
					<pg:index export="pages">
						<table>
						<tr>
						<td>
							当前<b class="fontred"><%= currentPage%></b>/<%=pages%>页&nbsp;&nbsp;&nbsp;&nbsp;
						</td>
						<td>
						<pg:first>
							<a href="<%=pageUrl%>&pageNo=<%=pageNumber%>">首页</a>
						</pg:first>
						</td>
						<td>	
						<pg:prev>
							<a href="<%=pageUrl%>&pageNo=<%=pageNumber%>">上一页</a>
						</pg:prev>
						</td>
						<td>
						<pg:pages>
							<%
								if (currentPage == pageNumber) {
							%>
							<font color="red"><%=pageNumber%></font>
							<%
								} else {
							%>
							<a href="<%=pageUrl%>&pageNo=<%=pageNumber%>"><%=pageNumber%></a>
							<%
								}
							%>
						</pg:pages>
						</td>
						<td>
						<pg:next>
							<a href="<%=pageUrl%>&pageNo=<%=pageNumber%>">下一页</a>
						</pg:next>
						</td>
						<td>
						<pg:last>
							<a href="<%=pageUrl%>&pageNo=<%=pageNumber%>">末页</a>&nbsp;&nbsp;&nbsp;&nbsp;
						</pg:last>
						</td>
						
						<td>
							&nbsp;
						</td>
						<td style="padding-left: 10px;">
							每页显示的记录数
						</td>
						<td>
							<input type="text" class="inputDftText" value="<%=pageSize %>" onchange="Ext.get('pageSize').dom.value=this.value;Ext.get('roleForm').dom.submit();"/>
						</td>
						<td>
							条
						</td>
						<td>
							&nbsp;
						</td>
						</tr>
						</table>
					</pg:index>

				</pg:pager>
				</td>
				</tr>
		</table>
</div>
</body>